<?php header("Content-Type:text/html;   charset=utf-8"); ?>
<script type="text/javascript">
	$(function(){
		//loadInterview();
		$("#btnQueryInterview").bind("click",loadInterview);
		$("#hrefDelInterview").bind("click",delSelectInterview);
	});	
	function delSelectMultiInterview(ids){
		var params={ids:ids};
 	 	var url="admin.php/manage/deleteInteview";
 	 	$.ajax({
 	 	 	type:"post",
 	 	 	url:url,
 	 	 	dataType:"json",
 	 	 	data:params,
 	 	 	success:function(data){
 	 	 	 	
				if(data.statusCode=="1"){
					loadInterview();
					alert('删除成功');
				}else{
					alert('删除失败');
				}
 	 	 	}
 	 	});
	}
 	function delSelectInterview(){
 	 	var selIds=getSelectIdsInterview();
 	 	if(selIds==""){
 	 	 	alert('请选择要删除的项');
 	 	 	return;
 	 	}
 	 	if(confirm('删除后不可恢复，确认要删除吗？')==false)
 	 	 	return; 	
 	 	delSelectMultiInterview(selIds);	
 	}
 	function delInterview(id){
 	 	if(confirm('确定要删除吗？')==false)
 	 	 	return;
 	 	delSelectMultiInterview(id);
 	}
 	
	function getSelectIdsInterview(){
		var sel = "";
		$("#tableInterview td :checkbox:checked").each(function(){
			sel+=$(this).val()+",";
		});
		return sel;
	}		
	function loadInterview(){
		$("#chkSelectAllInterview").attr("checked",false);		
		var url="admin.php/manage/loadInteview";
        var params = {realname:$("#txtRealname").val()};
		$.ajax({
			type:"post",
			url:url,
            data:params,
			dataType:"html",			
			success:function(data){
				$("#tableInterview").html(data);
				bindSelect("chkSelectAllInterview","tableInterview");				
			}
		});	
	}
</script>
<form id="pagerForm" method="post" action="admin.php/manage/baominInteview">
    <input type="hidden" name="numPerPage" value="20" />
    <input type="hidden" name="pageNum" value="1" />
</form>
<div class="pageHeader">
	<form>
		<div class="searchBar">
			<table class="searchContent">
				<tr>
                    <td>姓名：<input type="text" id="txtRealname" class="textInput" /></td>
					<td>
						<div class="subBar">
							<ul>
								<li><div class="buttonActive">
										<div class="buttonContent">
											<button id="btnQueryInterview" type="button" style="width: 100px">查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;询</button>
										</div>
									</div></li>
							</ul>
						</div>
					</td>
				</tr>
			</table>

		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li style="display: none"><a id="hrefEditInterview" class="edit" href=""
				lookupgroup="orgLookup"><span>修改</span></a></li>
			<li><a id="hrefDelInterview" class="delete" href="javascript:void(0)"><span>删除</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th style='width: 30px; text-align: center;'><input type='checkbox' id='chkSelectAllInterview' /></th>
				<th style='width: 40px'>编号</th>
				<th style='width: 200px'>姓名</th>
				<th style='width: 100px'>微信号</th>
				<th style='width: 60px'>操作</th>

			</tr>
		</thead>
		<tbody id="tableInterview">
        <?php foreach($data['data'] as $item):?>
            <tr>
                <td style="width: 23px; text-align: center;"><input type="checkbox" value="<?php echo $item['id'];?>" /></td>
                <td><?php echo $item['id'];?></td>
                <td><?php echo $item['realname'];?></td>
                <td><?php echo $item['weixin'];?></td>
                <td><a href='javascript:void(0)' onclick="delSelectMultiInterview(<?php echo $item['id'];?>)">删除</a></td>
            </tr>
        <?php endforeach;?>
		</tbody>
	</table>
    <div class="panelBar">
        <div class="pages">

            <span>共<?php echo $data['sum'];?>条</span>
        </div>

        <div class="pagination" targetType="navTab" totalCount="<?php echo $data['sum'];?>" numPerPage="<?php echo $data['pageSize'];?>" pageNumShown="<?php echo $data['count'];?>" currentPage="<?php echo $data['page'];?>"></div>

    </div>
</div>





























